package sk.klimo.prototyp.client;


import sk.klimo.prototyp.client.model.Invoice;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.Tree;
import com.google.gwt.user.client.ui.TreeItem;
import com.google.gwt.user.client.ui.VerticalPanel;

public class LeftPane extends Composite {

	private Tree tree;

	public LeftPane() {
		super();
		final VerticalPanel rootPanel = new VerticalPanel();
		initWidget(rootPanel);

		ListBox lb = new ListBox();
		lb.addItem("Podla mena firmy", "company");
		lb.addItem("Podla datumu", "date");
		lb.setSize("100%", "75%");
		rootPanel.add(lb);
		rootPanel.setCellHeight(lb, "30px");

		TreeItem root = new TreeItem("root");

		tree = new Tree();
		tree.addItem(root);

		rootPanel.setSize("100%", "100%");
		rootPanel.add(tree);
	}

	public Tree getTree() {
		return tree;
	}

	public void addInvoice(Invoice invoice) {
		tree.addItem(invoice.getCislo());
	}
}
